package service

import (
	"context"

	"gitee.com/hust-ideas/little-genius-backend/dal/db/keywords"
	model "gitee.com/hust-ideas/little-genius-backend/model"
)

// KeywordSavePost - 保存关键词模式
func (s *ServiceContext) KeywordSavePost(req model.KeywordSaveReq, ctx context.Context) (resp model.KeywordSaveResp, err error) {
	err = s.Model.KeywordsModel.Insert(ctx, &keywords.Keywords{
		KUId:        req.UserId,
		KName:       req.Keyword.Name,
		KGrade:      req.Keyword.Grade,
		KSubject:    req.Keyword.Subject,
		KDifficulty: req.Keyword.Difficulty,
	})
	if err != nil {
		return
	}
	resp = model.KeywordSaveResp{}
	return
}
